﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
    <script src="../0_System_file/js/jquery.min.js"></script>
    <script src="../0_System_file/js/jquery.easyui.min.js"></script>
    <script src="../0_System_file/js/validatebox.js"></script>
    <link href="../0_System_file/themes/default/easyui.css" rel="stylesheet" />
    <link href="../0_System_file/themes/icon.css" rel="stylesheet" />
    <link href="../0_System_file/themes/Site (1).css" rel="stylesheet" />
    <script type="text/javascript">
        $(function () {
            $("#dga").datagrid({
                fitColumns: true,
                toolbar: "#tb",
                pagination: true,
                //fit:true,
                singleSelect: true,
                rownumbers: true,
                method: "get",
                url:"/10_Json/datagrid_data1.json",
                columns: [[
                    { field: "productid", title: "商铺ID", width: 100 },
                    { field: "productname", title: "商铺名称", width: 100 },
                    { field: "unitcost", title: "价格", width: 100 }
                ]]
            });
            $("#btnAdd").click(function () {
                $("#dlg").dialog({ width: 400, height: 400 })
                .dialog("setTitle", "添加用户")
                .dialog("open");
                $("#frm1").attr("src", "02_Add.html");
            });
            $("#btnUpdate").click(function () {
                var row = $("#dga").datagrid("getSelected");
                if (row != null) {
                    $("#dlg").dialog({ width: 400, height: 400 })
                    .dialog("setTitle", "修改用户")
                    .dialog("open");
                    $("#frm1").attr("src", "05_toggle.html");
                }
                else {
                    $.messager.alert("提示", "请选择需要编辑的行", "warning");
                }
            });
            $("#btnDelete").click(function () {
                var row1 = $("#dga").datagrid("getSelected");
                if (row1 != null) {
                    //$("#dlg").dialog({ width: 400, height: 400 })
                    //.dialog("setTitle", "删除用户")
                    //.dialog("open");

                    $.messager.confirm("警告", "您确认要删除商铺 " + row1.itemid + " 吗？", function (y) {
                        if (y) {
                            //$("#frm1").attr("src", "Delete.html" + row1.itemid);
                            $.messager.alert("温馨提示", "商铺 " + row1.itemid + " 已删除");
                        }
                    })
                }
                else {
                    $.messager.alert("提示", "请选择需要删除的行", "warning");
                }
            });
           
            $.extend($.messager.defaults, {
                ok: "确定",
                cancel: "取消"
            });

        });
    </script>
</head>
<body>
    <form id="ff" method="post">
        <fieldset style="border-color:cornflowerblue;border:1px;">
            <div id="tb" style="padding:5px;height:auto">
                <a id="btnAdd" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>
                <a id="btnUpdate" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>
                <a id="btnDelete" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>
                <br />
                <hr />
                <label>店铺名称:</label>
                <input id="productid" type="text" name="name" />
                <label>联系人:</label>
                <input id="productname" type="text" name="email2" />
                <label>店铺地址:</label>
                <input id="unitcost" type="text" name="email23" />
                <a id="btnAllot" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
            </div>
            <div id="dlg" class="easyui-dialog" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true">
                <iframe id="frm1" width="99%" height="99%" frameborder="0"></iframe>
            </div>
            <table id="dga"></table>
        </fieldset>
    </form>

</body>
</html>
